<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> 
<%@include file="/common/dev_header.jsp" %>
        <div class="row">
            <table class="table table-bordered">
          	<thead>
          		<tr>
          			<th>id</th>
          			<th>时间</th>
          			<th>url</th>
          			<th>参数</th>
          			<th>是否成功</th>
          			<th>错误消息</th>
          			<th>IP地址</th>
          			<th>请求方式</th>
          			<th>操作</th>
          		</tr>
          	</thead>
          	<tbody>
          		<c:forEach items="${logs }" var="log">
	          		<tr>
	          			<td>${log.id }</td>
	          			<td>
	          				<fmt:formatDate value="${log.date }" pattern="yyyy-MM-dd HH:mm:ss"/>
	          			</td>
	          			<td>${ctx}${log.url }</td>
	          			<td style="width:200px;word-break:break-all">${log.formattedParams }</td>
	          			<td>${log.isSuccess ? '是' : '否' }</td>
	          			<td>${log.errorMessage }</td>
	          			<td>${log.ip }</td>
	          			<td>${log.requestMethod }</td>
	          			<!-- 
	          				<td>${log.ua}</td>
	          			 -->
	          			 <td>
	          			 	<c:if test="${empty(log.params) }">
	          			 		<a href="${ctx}${log.url }" target="_blank">重放</a>
	          			 	</c:if>
	          			 	<c:if test="${not empty(log.params) }">
	          			 		<a href="${ctx}${log.url }?${log.formattedParams}" target="_blank">重放</a>
	          			 	</c:if>
	          			 </td>
	          		</tr>
          		</c:forEach>
          	</tbody>
          </table>
        </div>
        
    	
<%@include file="/common/dev_footer.jsp" %>